<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>模块管理</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
    <script type="text/javascript" th:src="@{/laydate/laydate.js}"></script>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
    <script>
        function tip(ele) {
            $(".tipright p").text("有新模块已赋权，请重新登录！");
            $("#tip").fadeIn(200);
        }
        function tipClose() {
            $("#tip").fadeOut(200);
        }
        function tip2(ele) {
            $(".tipright p").text("新模块添加成功！");
            $("#tip2").fadeIn(200);
        }
        function tipClose2() {
            $("#tip2").fadeOut(200);
        }
    </script>
</head>

<body>
<div class="place"><span>位置：</span>
    <ul class="placeul">
        <li><a href="../users/userList.html">系统管理</a></li>
        <li><a href="moduleList.html">模块管理</a></li>
        <li><a href="#">添加</a></li>
    </ul>
</div>
<div class="formbody">
    <div class="formtitle"><span>模块信息</span></div>
    <form th:action="@{/sys/modules/doAdd}" method="post">
        <ul class="forminfo">
            <li>
                <label>模块名称</label>
                <input name="moduleRname" type="text" class="dfinput"/><i>必填，不能超过30个字符</i>
            </li>
            <li>
                <label>父模块</label>
                <select name="modulePid" class="dfselect">
                    <option value="0">请选择父模块</option>
                    <option th:each="parent:${parentModule}"
                            th:value="${parent.moduleId}"
                            th:text="${parent.moduleRname}">系统管理
                    </option>
                </select>
            </li>
            <input type="hidden" name="moduleState" value="1"/>
            <li>
                <label>URL</label>
                <input name="moduleMurl" type="text" class="dfinput"/><i>必填，不能超过30个字符</i>
            </li>
            <li>
                <label>&nbsp;</label>
                <input th:if="${session.users.getJobId()==1}" onclick="tip(this)" name="" type="submit" class="btn" value="确认保存"/>
                <input th:if="${session.users.getJobId()!=1}" onclick="tip2(this)" name="" type="submit" class="btn" value="确认保存"/>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="" type="button" class="btn" value="返回" onclick="window.history.go(-1);"/>
            </li>
        </ul>
    </form>

    <!-- 提示框 -->
    <div id="tip" class="tip">
        <div class="tiptop"><span>提示信息</span><a onclick="tipClose()"></a></div>
        <div class="tipinfo"> <span><img th:src="@{/images/ticon.png}" /></span>
            <div class="tipright">
                <p></p>
                <cite></cite> </div>
        </div>
        <div class="tipbtn">
            <input name="" type="button"  class="sure" value="确定" onclick="tipClose()" />
            &nbsp;
            <input name="" type="button"  class="cancel" value="取消" onclick="tipClose()" />
        </div>
    </div>

    <!-- 提示框2 -->
    <div id="tip2" class="tip">
        <div class="tiptop"><span>提示信息</span><a onclick="tipClose2()"></a></div>
        <div class="tipinfo"> <span><img th:src="@{/images/ticon.png}" /></span>
            <div class="tipright">
                <p></p>
                <cite></cite> </div>
        </div>
        <div class="tipbtn">
            <input name="" type="button"  class="sure" value="确定" onclick="tipClose2()" />
            &nbsp;
            <input name="" type="button"  class="cancel" value="取消" onclick="tipClose2()" />
        </div>
    </div>
</div>
</body>
</html>
